package com.study.polymorphism1;

public class Text {
    public  void main(String[] args) {
        Student s = new Student();
        s.setName("张三");
        s.setAge(24);

        Tercher t = new Tercher();
        t.setName("李四");
        t.setAge(22);
 
        Administrator a = new Administrator();
        a.setName("管理员");
        a.setAge(20);


        register(s);
        register(t);
        register(a);
    }
 
    public static void register(Person p) {
        p.show();
    }
}
